package cn.wolfcode.shop.activemq.config;

import cn.wolfcode.shop.util.ActiveMQConstants;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.jms.Destination;

/**
 * ActiveMQ配置类
 */
@Configuration
public class ActiveMQConfig {

    /**
     * 发送队列消息的目的地
     * 将对象交给容器管理
     * @return
     */
    @Bean
    public Destination orderQueue(){
        Destination destination=new ActiveMQQueue(ActiveMQConstants.ORDER_DESTINATION);
        return destination;
    }

}
